package com.zut.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

// 把一个普通的类变成配置类，（类似于 applicationContext.xml）
@Configuration
// 开启 swagger2
@EnableSwagger2
public class Swagger2Config {

    @Bean
    public Docket docket(){
        // 把 新建的对象放到容器中
        return new Docket(DocumentationType.SWAGGER_2);
    }
}
